package com.zhsq.zlc.service.customer;

import com.zhsq.zlc.dao.customer.CustomerMapper;
import com.zhsq.zlc.entity.CustomerEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class CustomerServiceImpl implements CustomerService {

    @Autowired
    private CustomerMapper customerMapper;
    @Override
    @Transactional
    public int count(CustomerEntity entity) {
        return customerMapper.count(entity) ;

    }

    @Override
    @Transactional
    public List<CustomerEntity> list(CustomerEntity entity) {
        return customerMapper.list(entity);
    }

    @Override
    @Transactional
    public CustomerEntity getCustomerById(CustomerEntity entity) {
        return customerMapper.getCustomerById(entity);
    }

    @Override
    @Transactional
    public void edit(CustomerEntity entity) {
        customerMapper.edit(entity);
    }

    @Override
    @Transactional
    public void add(CustomerEntity entity) {
        customerMapper.add(entity);
    }

    @Override
    @Transactional
    public void delete(int intID) {
        customerMapper.delete(intID);
    }
}
